﻿/*
Copyright 2012 DaCoder
This file is part of daCoders Tool for WoW 1.12.1.
daCoders Tool for WoW 1.12.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
daCoders Tool for WoW 1.12.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Foobar. If not, see http://www.gnu.org/licenses/.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpenHack
{
    public class ListWoWObjects
    {
        private int size;
        public WowObject Head;

        public ListWoWObjects()
        {
            size = 0;
            Head = null;
        }

        public int Count
        {
            get { return size; }
        }

        public int Add(WowObject NewItem)
        {
            WowObject gameObject = new WowObject();

            gameObject = NewItem;
            gameObject.next = Head;
            Head = gameObject;
            return size++;
        }

        public WowObject Get(int Position)
        {
            WowObject Current = Head;

            for (int i = 0; i < Position && Current != null; i++)
                Current = Current.next;
            return Current;
        }
    }
}
